Skip to content

gccrs: fix ICE in convert_tree for tuple destructuring with ref #4059

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 17, 2025

Conversation

Lishin1215
Copy link
Contributor

Fixes #3645

gcc/rust/ChangeLog:

* backend/rust-compile-pattern.cc (CompilePatternLet::visit): Handle tuple destructuring containing by-ref.

gcc/testsuite/ChangeLog:

* rust/compile/issue-3645.rs: New test.

gcc/rust/ChangeLog:

	* backend/rust-compile-pattern.cc (CompilePatternLet::visit):
	Handle tuple destructuring containing by-ref.

gcc/testsuite/ChangeLog:

	* rust/compile/issue-3645.rs: New test.

Signed-off-by: lishin <[email protected]>
@powerboat9
Copy link
Collaborator

Really, all matching should operate on a place/lvalue/etc

https://doc.rust-lang.org/reference/expressions/match-expr.html
https://doc.rust-lang.org/reference/patterns.html#binding-modes

our current handling of binding modes leaves much to be desired.

@CohenArthur CohenArthur requested a review from philberty August 11, 2025 08:48
@Lishin1215
Copy link
Contributor Author

@powerboat9 I see. Thanks for pointing that out!
I’ll take a closer look to understand how the binding modes work better.
For now, I’m happy to follow up or adjust this PR if there’s a better way to address it in the larger context.

Copy link
Member

@philberty philberty left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@philberty
Copy link
Member

Really, all matching should operate on a place/lvalue/etc

https://doc.rust-lang.org/reference/expressions/match-expr.html https://doc.rust-lang.org/reference/patterns.html#binding-modes

our current handling of binding modes leaves much to be desired.

Last i remember looking at rustc they have more abstractions around, which we dont have i think this is fine for where we are now

@philberty philberty added this pull request to the merge queue Aug 17, 2025
Merged via the queue into Rust-GCC:master with commit 5d16ff4 Aug 17, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ICE: in convert_tree, at rust/rust-gcc.cc:1922 tupel destruct w ref
3 participants